package cn.newtouch.exception;

import cn.newtouch.enums.GlobalEnum;
import lombok.Data;

@Data //需要提供getter方法
public class GlobalCustomException extends RuntimeException{

    private String errorMessage;
    private String errorCode;

    public GlobalCustomException() {
        super();
    }

    public GlobalCustomException(String message) {
        super(message);
    }

    public GlobalCustomException(String errorMessage,String errorCode) {
        super(errorMessage);
        this.errorMessage=errorMessage;
        this.errorCode=errorCode;
    }

    public GlobalCustomException(GlobalEnum globalEnum) {
        super(globalEnum.getErrorMessage());
        this.errorMessage=globalEnum.getErrorMessage();
        this.errorCode=globalEnum.getErrorCode();
    }

}
